<?php

defined( 'PDNS_CORE' ) or die( "Unauthorized" );

class SSL{
	/**
	 *  Ensures an ssl (https) connection is used
	 */
	static public function enforce_ssl(){
		if( $_SERVER['HTTPS'] == 'on' )
			return;

        $url = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
		header('Location: '.$url);
		die();
	}
}
